package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.PurchasingDao;
import com.neuedu.model.Purchasing;
import com.neuedu.service.PurchasingService;

//配置一个spring的服务，把业务实现类交给spring进行管理，由spring完成依赖注入
@Service
public class PurchasingServiceImpl implements PurchasingService {

	
	//织入-依赖注入
	@Autowired
	private PurchasingDao PurchasingDao;
	
	public void setPurchasingDao(PurchasingDao purchasingDao) {
		PurchasingDao = purchasingDao;
	}

	@Override
	public int countPurchasing() {
		// TODO Auto-generated method stub
		return PurchasingDao.countPurchasing();
	}

	@Override
	public List<Purchasing> findAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return PurchasingDao.findAll(map);
	}

	@Override
	public int addPurchasing(Purchasing c) {
		// TODO Auto-generated method stub
		return PurchasingDao.addPurchasing(c);
	}

	@Override
	public int updatePurchasing(Purchasing c) {
		// TODO Auto-generated method stub
		return PurchasingDao.updatePurchasing(c);
	}

	@Override
	public int deletePurchasing(int id) {
		// TODO Auto-generated method stub
		return PurchasingDao.deletePurchasing(id);
	}

}
